#include "TcpSocket.h"

TcpSocket::TcpSocket(int connfd, sockaddr_in cliaddr)
    : m_connfd(connfd), m_cliaddr(cliaddr)
{
    LOGI("new Tcpsocket connid %d", m_connfd);
}

void TcpSocket::OnClose()
{
    close(m_connfd);
}

int TcpSocket::SendBuffer(const void *buf, int len)
{
    return send(m_connfd, buf, len, 0);
}

int TcpSocket::RecvBuffer(void *buf, int len)
{
    return recv(m_connfd, buf, len, 0);
}
